libxl: suspend: Abolish usleeps in domain suspend wait
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 6 Dec 2013 16:12:44 +0000 (16:12 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 17 Mar 2014 15:54:00 +0000 (15:54 +0000)
commit926e112b20bd6b928df43c6674404e8353e57915
tree14c5862bc3e6275389f8a055eec7783fa649ed30
parentd12e4ad65c2bf5c9a8ca2c40295e72f1279036c4
libxl: suspend: Abolish usleeps in domain suspend wait

Replace the use of a loop with usleep().

Instead, use a xenstore watch and an event system timeout.  (xenstore
fires watches on @releaseDomain when a domain shuts down.)

The logic which checks for the state of the domain is unchanged, and
not ideal, but we will leave that for the next patch.

There is not intended to be any semantic change, other than to make
the algorithm properly asynchronous and the consequential waiting be
on xenstore, rather than polling.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v3: Remove some trailing whitespace
    Improve commit message.
v3X: Do NOT use an xswait instead of separate watch and timeout.
tools/libxl/libxl_dom.c
tools/libxl/libxl_internal.h